package com.gotop.mapper.common.service.impl;

import com.gotop.entity.log.LogApi;
import com.gotop.entity.log.LogError;
import com.gotop.entity.log.LogUsual;
import com.gotop.mapper.common.service.LogService;
import com.gotop.mapper.log.LogApiDao;
import com.gotop.mapper.log.LogErrorDao;
import com.gotop.mapper.log.LogUsualDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: cem
 * @description:
 * @author: superfish
 * @create: 2020-12-28 14:49
 **/
@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogUsualDao logUsualDao;
    @Autowired
    private LogApiDao logApiDao;
    @Autowired
    private LogErrorDao logErrorDao;

    @Override
    public Boolean saveUsualLog(LogUsual log) {
        if (1 == logUsualDao.insert(log)) {
            return true;
        }
        return false;
    }

    @Override
    public Boolean saveApiLog(LogApi log) {
        if (1 == logApiDao.insert(log)) {
            return true;
        }
        return false;
    }

    @Override
    public Boolean saveErrorLog(LogError log) {
        if (1 == logErrorDao.insert(log)) {
            return true;
        }
        return false;
    }

}
